package fr.generali.accueilclient.gwt.client.state.store;

import com.google.gwt.core.client.Callback;
import com.google.gwt.user.client.rpc.AsyncCallback;

import fr.generali.accueilclient.gwt.client.state.StateStore;

public abstract class AbstractRpcStateStore implements StateStore {

	@Override
	public void get(String name, final Callback<String, Throwable> callback) {
		getValue(name, new AsyncCallback<String>() {
			@Override
			public void onSuccess(String result) {
				callback.onSuccess(result);
			}

			@Override
			public void onFailure(Throwable caught) {
				callback.onFailure(caught);
			}
		});
	}

	public abstract void getValue(String name, AsyncCallback<String> callback);

}